package cn.italkcloud.cph.constants.enums.vos;

import lombok.Getter;

/**
 * 锁定类型 0未锁定 1锁定
 *
 * @author dominate
 * @since 2024/7/9
 **/
@Getter
public enum LockTypeEnum {

    UN_LOCK(0, "未锁定"),
    LOCK(1, "锁定");

    final int code;
    final String name;

    LockTypeEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static LockTypeEnum getValueByCode(int code) {
        for (LockTypeEnum value : LockTypeEnum.values()) {
            if (code == value.getCode()) {
                return value;
            }
        }
        return LOCK;
    }

    public static String getName(int code) {
        return getValueByCode(code).getName();
    }
}
